<template>
  <div class="home-nav">
    <ul>
      <li class="home-nav-item" v-for="item of list" :key="item.id">
        <img :src="item.imgUrl" alt="item.id" />
        <div class="home-nav-item-desc">{{ item.desc }}</div>
      </li>
    </ul>
  </div>
</template>

<script setup>
defineProps({
  list: {
    type: Array,
    default: () => []
  }
})
</script>

<style lang="scss" scoped>
.home-nav {
  width: 100%;
  padding: .2rem .1rem;
  background-color: #fff;
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    // align-content: center;
    width: 100%;
    height: 100%;
    gap: .2rem 0;
    li {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 30%; // 每行3列，留些间隙
      margin-bottom: 0.3rem;
      img {
        width: 1.2rem;
        height: 1.2rem;
        object-fit: contain;
      }
      .home-nav-item-desc {
        margin-top: 0.1rem;
        font-size: 0.28rem;
        color: #333;
        text-align: center;
      }
    }
  }
}
</style>
